package com.prs.crm.dao.document.impl;

import java.sql.SQLException;
import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;
import org.springframework.orm.hibernate3.HibernateCallback;

import com.prs.crm.dao.document.DraftDao;
import com.prs.crm.dao.impl.BaseDaoImpl;
import com.prs.crm.domain.document.Draft;

public class DraftDaoImpl extends BaseDaoImpl<Draft> implements DraftDao{

	@SuppressWarnings("unchecked")
	@Override
	public List<Draft> getAllDraft() {
		return this.getHibernateTemplate().executeFind(new HibernateCallback() {
			public Object doInHibernate(Session session)
					throws HibernateException, SQLException {
				Criteria criteria=session.createCriteria(Draft.class);
				return criteria.list();
			}
		});
	}
}
